<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
	
	<h:head>
	</h:head>
	<h:body>
		<ui:composition template="../Layout/principal.xhtml">
			<ui:define name="content">
				<p:panel>
					<h:form prependId="false">
						
						<h:panelGrid id="add" columns="1" >
						<p:messages />
							<h:outputLabel for="nome" value="Nome" />
							<h:inputText id="nome" value="#{usuarioController.usuario.no_usuario}" required="true" requiredMessage="Nome: Campo Obrigatório."/>
				
							<h:outputLabel for="senha" value="Senha" />
							<p:password id="senha" value="#{usuarioController.usuario.no_senha}" minLength="4" maxlength="16" strongLabel="Senha Forte" weakLabel="Senha Fraca" goodLabel="Senha Média" required="true" requiredMessage="Senha: Campo Obrigatório."/>
							
							<h:outputLabel for="email" value="Email" />
							<h:inputText id="email" value="#{usuarioController.usuario.no_email}" validatorMessage="E-mail não é válido." required="true" requiredMessage="Email: Campo Obrigatório.">
								<f:validateRegex pattern="^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$"/>
							</h:inputText>
				
							<p:commandButton update="add"
								actionListener="#{usuarioController.adiciona}"
								value="Cadastrar" />
				
						</h:panelGrid>
					</h:form> 
				</p:panel>
			</ui:define>
		</ui:composition>
	</h:body>
	</html>